# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.
"""
from NewmarkCD import newmarkCD 
import numpy as np

def spectrumD(file,T):
    
    fa = np.loadtxt(file)
    
    Sd = np.zeros(len(T))
    dta = fa[1,0]-fa[0,0]
    Npt = len(fa[:,0])
    
    
    for i in range(1,len(T)):
        Sd[i] = newmarkCD(T[i],0.05,fa[:,1],dta,Npt)/1000
        
    return Sd
    




